iommu: Actually clear IO-APIC pins on boot and shutdown when used with an IOMMU
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:32:35 +0000 (12:32 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Dec 2009 12:32:35 +0000 (12:32 +0000)
commit142a10c6c8d52689e9770e5f61bcce7b4af9095a
treed84b26d6af6904672180889c8bfbba411ac75699
parent5a396b13fd70696a6e62eca387d4e4b51dbb6853
iommu: Actually clear IO-APIC pins on boot and shutdown when used with an IOMMU

When booted with iommu=on, io_apic_read/write functions call into the
interrupt remapping code to update the IRTEs.  Unfortunately, on boot
and shutdown, we really want clear_IO_APIC() to sanitize the actual
IOAPIC RTE, and not just the bits that are active when interrupt
remapping is enabled.  This is particularly a problem on older
versions of Xen which used the IOAPIC RTE as the canonical source for
the IRTE index.  In that case, clear_IO_APIC() actually causes
whatever happens to be stored in the RTEs to be used as an IRTE index,
which can come back and bite us in ioapic_guest_write() if we attempt
to remove an interrupt that didn't actually exist.  Current upstream
appears less susceptible to errors since the IRTE index is stored in
an array, but it's still a good idea to sanitize the IOAPIC state.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/io_apic.c
xen/include/asm-x86/io_apic.h